var infoTexts = [];
var registersInfo = null;
function getRegisterInfo() {
	infoTexts = [];
	return getWebInfoAndReg();
}

function getWebInfoAndReg() {
	registersInfo = $('input');

	infoTexts = [];
	for (var i = 0; i < registersInfo.length - 2; i++) {
		if (registersInfo[i].value == '') {
			alert('请输入完整信息！');
			return false;
		}
		infoTexts.push(registersInfo[i].value);
	}
	infoTexts.push(registersInfo[4].checked);
	if (!checkUserRegex(infoTexts[0])) {
		return false;
	}

	if (!checkUserPwd(infoTexts[1], infoTexts[2])) {
		return false;
	}

	if (!validate(infoTexts[3])) {
		return false;
	}

	if (!checkAgreement()) {
		alert('请接受《住房邦服务协议》！');
		return false;
	}
	return getRegFormParams(infoTexts);
}

function checkUserRegex(phoneNum) {
	var reg = /^1[358]\d{9}$/;
	if (!reg.test(phoneNum)) {
		alert(phoneNum + '手机号码不正确！');
		return false;
	}
	return true;
}

function checkEmail(email) {
	var reg = /^([0-9A-Za-z\-_\.]+)@([0-9a-z]+\.[a-z]{2,3}(\.[a-z]{2})?)$/g;
	var bResult = reg.test(email);
	return bResult;
}

function checkUserPwd(param1, param2) {
	var reg = /^[\d\w\W]{6,20}$/;
	if (!reg.test(param1) && !reg.test(param2)) {
		alert('密码为：6-20位字母、数字组合，区分大小写');
		return false;
	}
	if (infoTexts[1] != infoTexts[2]) {
		alert('输入密码不匹配！');
		return false;
	}
	return true;
}

function checkNumber(value) {
	if (value != "") {
		var reg = /\d/g;
		if (reg.test(value)) {
			return true;
		}
		alert("请输入数字！！！");
		return false;
	}
}

function checkAgreement() {
	return registersInfo[4].checked;
}

function getRegFormParams(params) {
	return 'username=' + params[0] + '&password=' + params[1] + '&repsw='
			+ params[2];
}

function checkYear(year) {
	var reg = /^[1|2]\d{3}$/g;
	// var reg = /^[1|2]\d{3}-1[0-2]|[1-9]-[12][0-9]|3[01]|[1-9]$/g;
	if (reg.test(year)) {
		return true;
	}
	return false;
}

function checkBlank(selector) {
	var flag = true;
	$(selector).each(function(index, element) {
		if ($(this).val() == "") {
			$(this).change(function() {
				$(this).css("background-color", "#FFF");
			});
			$(this).focus().css("background-color", "#D6D6FF");
			if (flag) {
				alert("请填写完整信息！");
				flag = false;
			}
		}
	})
	return flag;
}

function loadOption(selector, arr) {
	var selectObj = $(selector);
	if (arr != [] && arr.length != 0) {
		for ( var index in arr) {
			selectObj.append($('<option value=' + arr[index].id + '>'
					+ arr[index].name + '</option>'));
		}
	}
}

function loadSpanId(selector, arr) {
	var selectObj = $(selector).empty();
	if (arr != [] && arr.length != 0) {
		for ( var index in arr) {
			selectObj.append($('<span id=' + arr[index].id + '>'
					+ arr[index].name + '</span>'));
		}
	}
}

function loadSpanLabel(selector, arr, flag) {
	var selectObj = $(selector).empty();
	if (arr != [] && arr.length != 0) {
		for ( var index in arr) {
			selectObj.append($('<span id=' + arr[index].value + '>'
					+ arr[index].label + '</span>'));
		}

		if (flag) {
			$(selector + ' span').click(function() {
				$(this).toggleClass("selected");
			});
		} else {
			$(selector + ' span').click(function() {
				otherCloseValue(this, "selected");
			});
		}
	}
}

function loadOptionLabel(selector, arr) {
	var selectObj = $(selector).empty();
	if (arr != [] && arr.length != 0) {
		for ( var index in arr) {
			selectObj.append($('<option value=' + arr[index].value + '>'
					+ arr[index].label + '</option>'));
		}
	}
}

function loadOptionLabelById(selector, arr) {
	loadOption(selector, arr.slice(3));
}

function selectProvides(selector, arr) {
	for ( var index in arr) {
		var watch = selector + ':contains(' + arr[index] + ')';
		$(selector + '[id=' + arr[index] + ']').attr("class", "selected");
	}
}

function selectOptionOfValue(selector, value) {
	$(selector + " option[value=" + value + "]").attr("selected", "selected");
}

var divStr1 = '<div id="imgId" style="clear:both;display:none;background-color:#2A2C32;color: #ABAEBE;font-size: 18px;padding:3px 5px 3px 5px;width: 110px;text-align: center;border-radius:5px"><span style="cursor:pointer;width:100%;display:block;border-radius:3px">注销</span><a style="font-size:18px;width:100%;display:block;border-radius:3px;color:#ABAEBE;text-decoration: none" href="'
		+ ctx + '"+"/h/front-8.html">设置</a>';

var divStr2 = '<div id="imgId" style="clear:both;display:none;background-color:#2A2C32;color: #ABAEBE;font-size: 18px;padding:3px 5px 3px 5px;width: 110px;text-align: center;border-radius:5px"><span style="cursor:pointer;width:100%;display:block;border-radius:3px">注销</span><a style="font-size:18px;width:100%;display:block;border-radius:3px;color:#ABAEBE;text-decoration: none" href="'
		+ ctx + '"+"/h/front-19.html">设置</a>';

$("div.user > div.cellphone,div.toolbar > div.cellphone").each(
		function(index, value) {
			var htmlType = $(this).parent().attr("class");
			switch (htmlType) {
			case "user":
				$(this).click(function() {
					if ($(this).text() == "登录") {
						window.location.href = "front-13.html";
					} else {
						$('#imgId').remove();
						followTag1(divStr1, this, -15, 10, 300);
					}
				})
				break;
			case "toolbar":
				$(this).click(function() {
					if ($(this).text() == "登录") {
						window.location.href = "front-13.html";
					} else {
						$('#imgId').remove();
						followTag2(divStr2, this, -15, 10, 300);
					}
				})
				break;
			}
		});

function followTag1(tarSelector, followSelector, offsetX, offsetY, timeout) {
	var top = Math.floor(Number($(followSelector).offset().top));
	var left = Math.floor(Number($(followSelector).offset().left));
	// var width = Number($(followSelector).width());
	var height = Number($(followSelector).height());
	var x = left + offsetX + "px";// +width;
	var y = top + height + offsetY + "px";
	var div = $(tarSelector).css({
		"left" : x,
		"top" : y
	}).css("position", "absolute");
	$("body").append(div);

	$("body.sidebar > div:last > span").click(function() {
		$.post(getUrl() + "a/sys/user/out", function(data) {
			if (data.errorCode == "200") {
				window.location.href = "front-13.html";
			}
		});
	});

	div.slideDown(timeout);
	div.children().hover(function() {
		$(this).css({
			"backgroundColor" : "#FFF",
			"color" : "#2A2C32"
		});
	}, function() {
		$(this).css({
			"backgroundColor" : "#2A2C32",
			"color" : "#ABAEBE"
		});
	});

	$(div).mouseleave(function() {
		$(this).slideUp(300, function() {
			$(this).remove();
		});
	});
}

function followTag2(tarSelector, followSelector, offsetX, offsetY, timeout) {
	var top = Math.floor(Number($(followSelector).offset().top));
	var left = Math.floor(Number($(followSelector).offset().left));
	// var width = Number($(followSelector).width());
	var height = Number($(followSelector).height());
	var x = left + offsetX + "px";// +width;
	var y = top + height + offsetY + "px";
	var div = $(tarSelector).css({
		"left" : x,
		"top" : y
	}).css("position", "absolute");
	$("body").append(div);

	$("body > div:last > span").click(function() {
		$.post(getUrl() + "a/sys/user/out", function(data) {
			if (data.errorCode == "200") {
				window.location.href = "front-13.html";
			}
		});
	});

	div.slideDown(timeout);
	div.children().hover(function() {
		$(this).css({
			"backgroundColor" : "#FFF",
			"color" : "#2A2C32"
		});
	}, function() {
		$(this).css({
			"backgroundColor" : "#2A2C32",
			"color" : "#ABAEBE"
		});
	});

	$(div).mouseleave(function() {
		$(this).slideUp(300, function() {
			$(this).remove();
		});
	});
}

function getKeyValue(arr, JQObjs) {
	var value = "";
	JQObjs.each(function(index, element) {
		value += checkLabel(arr, $(this).text()) + ",";
	});
	return value.substr(0, value.length - 1);
}

function getSingleSelVal(selector, cls) {
	return $(selector + "." + cls).val();
}

function loadRemoteDataMul(url, selector, func) {
	$.post(url, function(data) {
		result = data.data
		func(selector, result, false);
	});
}

function loadRemoteData(url, selector, func) {
	$.post(url, function(data) {
		result = data.data
		func(selector, result, true);
	});
}

function getArrForComma(selector, key) {
	var objs = $(selector);
	var results = "";
	objs.each(function(index, value) {
		results += $(this).attr(key) + ",";
	});
	return results.substr(0, results.length - 1);
}

function getLayout() {
	var flag = true;
	var result = "";
	for ( var index in arguments) {
		if (!checkNumber(arguments[index])) {
			flag = false;
		}
		result += arguments[index] + ",";
	}
	if (flag) {
		return result.substr(0, result.length - 1);
	} else {
		return "1,1,1";
	}
}

function checkLabel(arr, label) {
	var result = "";
	for ( var index in arr) {
		if (arr[index].label == label) {
			result = arr[index].value;
		}
	}
	return result;
}

function clickAddImages(selector, count, isBorder) {
	$(selector).click(function() {
		addImage(this, count, isBorder);
	});
}

function addImage(selector, maxCount, isBorder) {
	var maxCount = (maxCount == undefined || maxCount == null) ? 6
			: Number(maxCount);
	var isBorder = (isBorder == undefined || isBorder == null) ? true
			: Boolean(isBorder);
	if (isBorder) {
		imgLen = $(selector).parent().children(".img_border").length;
		if (imgLen < maxCount) {
			$('<div class="img_border"><div class="img_inner_border"></div>')
					.appendTo($($(selector).parent()));
			$(selector)
					.parent()
					.find(".img_inner_border")
					.hover(
							function() {
								$(this)
										.append(
												"<p style='cursor:pointer;position: absolute;float:right;color:black;padding:0px;margin:0px;top:-4px;right:8px;font-size:30px'>×</p>");
								$(this).find("p").click(function() {
									$(this).parent().parent().remove();
								});
							}, function() {
								$(this).find("p").remove();
							});
		} else {
			return;
		}
	} else {
		imgLen = $(selector).parent().children(".img_noborder").length;
		if (imgLen < maxCount) {
			$('<div class="img_noborder"><div class="img_inner_border"></div>')
					.appendTo($($(selector).parent()));
			$(selector)
					.parent()
					.find(".img_inner_border")
					.hover(
							function() {
								$(this)
										.append(
												"<p style='cursor:pointer;position: absolute;float:right;color:black;padding:0px;margin:0px;top:-4px;right:8px;font-size:30px'>×</p>");
								$(this).find("p").click(function() {
									$(this).parent().parent().remove();
								});
							}, function() {
								$(this).find("p").remove();
							});
		} else {
			return;
		}
	}
}

function deleImage(selector) {
	$(selector).remove();
}

function deleHouseById(url, id) {
	var param = {
		"rentingHouseIds" : id
	};
	$.post(url, param, function(data) {
		if (data.message == "success") {
			alert("删除成功！！！");
			window.location.reload();
		}
	});
}

function initFloor(spanSelector, floorSelector, srcType) {
	var value = $(spanSelector).text();
	switch (String(srcType)) {
	case "1":
		$(spanSelector).addClass("selected").siblings().removeClass('selected');
		$(floorSelector)
				.empty()
				.append(
						$('<input type="text" class="no_margin_min"> 层，共 <input type="text" class="no_margin_min"> 层'));
		break;
	case "2":
		$(spanSelector).addClass("selected").siblings().removeClass('selected');
		$(floorSelector).empty().append(
				$('<input type="text" class="no_margin_min">&nbsp层'));
		break;
	}
}

function clearSelector(selector, keepValue) {
	$(selector).empty().append($('<option>' + keepValue + '</option>'));
}

function loadData(data, selector, func) {
	func(selector, data, true);
}

var xzqData = null;
function loadAreaData_Client(xzqSelector, sqSelector, xqSelector, flagObj) {
	var sqData;
	var xqData;
	var commonUrl = getUrl();
	var xingzhengquUrl = commonUrl + "a/c/getAreaList";
	var shangquUrl = commonUrl + "a/c/getShangquanList";
	var xiaoquUrl = commonUrl + "a/c/getXiaoQu";
	if (xzqData == null) {
		$.post(xingzhengquUrl, function(data) {
			if (data.message == "success") {
				xzqData = data.data;
				loadData(xzqData, xzqSelector, loadOptionLabelById);
			}
		})
	} else {
		loadData(xzqData, xzqSelector, loadOptionLabelById);
	}

	$(xzqSelector).change(function() {
		clearSelector(sqSelector, "片区");
		clearSelector(xqSelector, "小区");
		var parentId = $(this).children("option:selected").val();
		if (parentId.indexOf("行政区") < 0) {
			flagObj.flag = false;
			var params = {
				"parentId" : parentId
			};
			$.post(shangquUrl, params, function(data) {
				loadOption(sqSelector, data.data);
			});
		} else {
			flagObj.flag = true;
		}
	});

	$(sqSelector).change(function() {
		clearSelector(xqSelector, "小区");
		var parentId = $(this).children("option:selected").val();
		if (parentId.indexOf("片区") < 0) {
			var params = {
				"parentId" : parentId
			};
			$.post(xiaoquUrl, params, function(data) {
				loadOption(xqSelector, data.data);
			});
		}
	});

	$(xqSelector).change(
			function() {
				if (String($(this).children("option:selected").val()).indexOf(
						"小区") < 0) {
					flagObj.flag = true;
				} else {
					flagObj.flag = false;
				}
			});
}

beginLoadPage();
function beginLoadPage() {
	var id = $('div.user > div.cellphone,div.toolbar > div.cellphone').attr(
			"id");
	if (!Boolean(id)) {
		window.location.href = "front-13.html";
	}
}

function otherCloseValue(selector, style) {
	$(selector).click(function() {
		$(this).addClass(style).siblings().each(function() {
			$(this).removeClass(style).text();
		});
	});
}

function loadAreaType(selector, key) {
	var val = $(selector).find('option:selected').val();
	if (String(val).indexOf(key) >= 0) {
		return "";
	}
	return val;
}

function loadClsValue(selector, key) {
	return $(selector + ".selected").attr(key);
}

function getRentContentNoDele_client(houseInfo) {
	var typeId = houseInfo.resourceType;
	var content = '';
	switch (String(typeId)) {
	case "1":
		content = '<div class="img-text" style="cursor:pointer;"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0]
				+ '"></div><div class="text">'
				+ houseInfo.title
				+ ' [<span id="'
				+ houseInfo.id
				+ '">'
				+ houseInfo.resourceTypeName
				+ '</span>]<br>户型：'
				+ houseInfo.layout.split(",")[0]
				+ '室'
				+ houseInfo.layout.split(",")[1]
				+ '厅'
				+ houseInfo.layout.split(",")[2]
				+ '卫<br>楼层：共'
				+ houseInfo.floor.split(",")[0]
				+ '层	   共'
				+ houseInfo.floor.split("/")[1]
				+ '<br>装修程度：'
				+ houseInfo.decorationLevelName
				+ '  '
				+ houseInfo.age
				+ '年建造<br>行政区：'
				+ houseInfo.officeName
				+ ' 片区：'
				+ houseInfo.serverAreaName
				+ ' 小区：'
				+ houseInfo.communtityName
				+ '<br>房源编号'
				+ getNotValue(houseInfo.resourceNum)
				+ '</div></div></td><td class="td3">'
				+ houseInfo.area
				+ '㎡</td><td class="td4"><a href="#">'
				+ houseInfo.rental
				+ '<span>元/月</span><br><a href="#" id="'
				+ getNotValue(houseInfo.brokers)
				+ '">房源详情>></a>';
		break;
	case "2":
		content = '<div class="img-text" style="cursor:pointer;"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0]
				+ '"></div><div class="text">'
				+ houseInfo.title
				+ ' [<span id="'
				+ houseInfo.id
				+ '">'
				+ houseInfo.resourceTypeName
				+ '</span>]<br>户型：'
				+ houseInfo.layout.split(",")[0]
				+ '室'
				+ houseInfo.layout.split(",")[1]
				+ '厅'
				+ houseInfo.layout.split(",")[2]
				+ '卫<br>楼层：共'
				+ houseInfo.floor
				+ '层<br>装修程度：'
				+ houseInfo.decorationLevelName
				+ '  '
				+ houseInfo.age
				+ '年建造<br>行政区：'
				+ houseInfo.officeName
				+ ' 片区：'
				+ houseInfo.serverAreaName
				+ ' 小区：'
				+ houseInfo.communtityName
				+ '<br>房源编号'
				+ getNotValue(houseInfo.resourceNum)
				+ '</div></div></td><td class="td3">'
				+ houseInfo.area
				+ '㎡</td><td class="td4"><a href="#">'
				+ houseInfo.rental
				+ '<span>元/月</span><br><a href="#" id="'
				+ getNotValue(houseInfo.brokers)
				+ '">房源详情>></a>';
		break;
	case "3":
		content = '<div class="img-text" style="cursor:pointer;"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0]
				+ '"></div><div class="text">'
				+ houseInfo.title
				+ ' [<span id="'
				+ houseInfo.id
				+ '">'
				+ houseInfo.resourceTypeName
				+ '</span>]<br>类型：'
				+ houseInfo.officeTypeName
				+ '    级别：'
				+ houseInfo.officeLevelName
				+ '<br>楼层：'
				+ houseInfo.floor.split("/")[0]
				+ '层       共'
				+ houseInfo.floor.split("/")[1]
				+ '层<br>装修程度：'
				+ houseInfo.decorationLevelName
				+ '  '
				+ houseInfo.age
				+ '年建造<br>行政区：'
				+ houseInfo.officeName
				+ ' 片区：'
				+ houseInfo.serverAreaName
				+ ' 小区：'
				+ houseInfo.communtityName
				+ '<br>房源编号'
				+ getNotValue(houseInfo.resourceNum)
				+ '</div></div></td><td class="td3">'
				+ houseInfo.area
				+ '㎡</td><td class="td4"><a href="#">'
				+ houseInfo.rental
				+ '<span>元/月</span><br><a href="#" id="'
				+ getNotValue(houseInfo.brokers)
				+ '">房源详情>></a>';
		break;
	case "4":
		content = '<div class="img-text" style="cursor:pointer;"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0]
				+ '"></div><div class="text">'
				+ houseInfo.title
				+ ' [<span id="'
				+ houseInfo.id
				+ '">'
				+ houseInfo.resourceTypeName
				+ '</span>]<br>商铺类型：'
				+ houseInfo.shopTypeName
				+ '<br>楼层：'
				+ houseInfo.floor.split("/")[0]
				+ '层      共'
				+ houseInfo.floor.split("/")[1]
				+ '层<br>装修程度：'
				+ houseInfo.decorationLevelName
				+ '  '
				+ houseInfo.age
				+ '年建造<br>行政区：'
				+ houseInfo.officeName
				+ ' 片区：'
				+ houseInfo.serverAreaName
				+ ' 小区：'
				+ houseInfo.communtityName
				+ '<br>房源编号'
				+ getNotValue(houseInfo.resourceNum)
				+ '</div></div></td><td class="td3">'
				+ houseInfo.area
				+ '㎡</td><td class="td4"><a href="#">'
				+ houseInfo.rental
				+ '<span>元/月</span><br><a href="#" id="'
				+ getNotValue(houseInfo.brokers)
				+ '">房源详情>></a>';
		break;
	}
	return content;
}

function getSellContentNoDele_client(houseInfo) {
	var typeId = houseInfo.resourceType;
	var content = '';
	switch (String(typeId)) {
	case "1":
		content = '<div class="img-text" style="cursor:pointer;"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0]
				+ '"></div><div class="text">'
				+ houseInfo.title
				+ ' [<span id="'
				+ houseInfo.id
				+ '">'
				+ houseInfo.resourceTypeName
				+ '</span>]<br>户型：'
				+ houseInfo.layout.split(",")[0]
				+ '室'
				+ houseInfo.layout.split(",")[1]
				+ '厅'
				+ houseInfo.layout.split(",")[2]
				+ '卫<br>楼层：共'
				+ houseInfo.floor.split(",")[0]
				+ '层	   共'
				+ houseInfo.floor.split("/")[1]
				+ '<br>装修程度：'
				+ houseInfo.decorationLevelName
				+ '  '
				+ houseInfo.age
				+ '年建造<br>行政区：'
				+ houseInfo.officeName
				+ ' 片区：'
				+ houseInfo.serverAreaName
				+ ' 小区：'
				+ houseInfo.communtityName
				+ '<br>房源编号'
				+ getNotValue(houseInfo.resourceNum)
				+ '</div></div></td><td class="td3">'
				+ houseInfo.area
				+ '㎡</td><td class="td4"><a href="#">'
				+ houseInfo.wishPrice
				+ '<span>万元</span><br><a href="#" id="'
				+ getNotValue(houseInfo.brokers)
				+ '">房源详情>></a>';
		break;
	case "2":
		content = '<div class="img-text" style="cursor:pointer;"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0]
				+ '"></div><div class="text">'
				+ houseInfo.title
				+ ' [<span id="'
				+ houseInfo.id
				+ '">'
				+ houseInfo.resourceTypeName
				+ '</span>]<br>户型：'
				+ houseInfo.layout.split(",")[0]
				+ '室'
				+ houseInfo.layout.split(",")[1]
				+ '厅'
				+ houseInfo.layout.split(",")[2]
				+ '卫<br>楼层：共'
				+ houseInfo.floor
				+ '层<br>装修程度：'
				+ houseInfo.decorationLevelName
				+ '  '
				+ houseInfo.age
				+ '年建造<br>行政区：'
				+ houseInfo.officeName
				+ ' 片区：'
				+ houseInfo.serverAreaName
				+ ' 小区：'
				+ houseInfo.communtityName
				+ '<br>房源编号'
				+ getNotValue(houseInfo.resourceNum)
				+ '</div></div></td><td class="td3">'
				+ houseInfo.area
				+ '㎡</td><td class="td4"><a href="#">'
				+ houseInfo.wishPrice
				+ '<span>万元</span><br><a href="#" id="'
				+ getNotValue(houseInfo.brokers)
				+ '">房源详情>></a>';
		break;
	case "3":
		content = '<div class="img-text" style="cursor:pointer;"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0]
				+ '"></div><div class="text">'
				+ houseInfo.title
				+ ' [<span id="'
				+ houseInfo.id
				+ '">'
				+ houseInfo.resourceTypeName
				+ '</span>]<br>类型：'
				+ houseInfo.officeTypeName
				+ '    级别：'
				+ houseInfo.officeLevelName
				+ '<br>楼层：'
				+ houseInfo.floor.split("/")[0]
				+ '层       共'
				+ houseInfo.floor.split("/")[1]
				+ '层<br>装修程度：'
				+ houseInfo.decorationLevelName
				+ '  '
				+ houseInfo.age
				+ '年建造<br>行政区：'
				+ houseInfo.officeName
				+ ' 片区：'
				+ houseInfo.serverAreaName
				+ ' 小区：'
				+ houseInfo.communtityName
				+ '<br>房源编号'
				+ getNotValue(houseInfo.resourceNum)
				+ '</div></div></td><td class="td3">'
				+ houseInfo.area
				+ '㎡</td><td class="td4"><a href="#">'
				+ houseInfo.wishPrice
				+ '<span>万元</span><br><a href="#" id="'
				+ getNotValue(houseInfo.brokers)
				+ '">房源详情>></a>';
		break;
	case "4":
		content = '<div class="img-text" style="cursor:pointer;"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0]
				+ '"></div><div class="text">'
				+ houseInfo.title
				+ ' [<span id="'
				+ houseInfo.id
				+ '">'
				+ houseInfo.resourceTypeName
				+ '</span>]<br>商铺类型：'
				+ houseInfo.shopTypeName
				+ '<br>楼层：'
				+ houseInfo.floor.split("/")[0]
				+ '层      共'
				+ houseInfo.floor.split("/")[1]
				+ '层<br>装修程度：'
				+ houseInfo.decorationLevelName
				+ '  '
				+ houseInfo.age
				+ '年建造<br>行政区：'
				+ houseInfo.officeName
				+ ' 片区：'
				+ houseInfo.serverAreaName
				+ ' 小区：'
				+ houseInfo.communtityName
				+ '<br>房源编号'
				+ getNotValue(houseInfo.resourceNum)
				+ '</div></div></td><td class="td3">'
				+ houseInfo.area
				+ '㎡</td><td class="td4"><a href="#">'
				+ houseInfo.wishPrice
				+ '<span>万元</span><br><a href="#" id="'
				+ getNotValue(houseInfo.brokers)
				+ '">房源详情>></a>';
		break;
	}
	return content;
}

function getRentContentNoDele_user(houseInfo, selector) {
	var typeId = houseInfo.resourceType;
	var content = '';
	var td2 = $(selector).parent().parent().parent();
	var td3 = $(td2).next();
	var td4 = $(td3).next();
	switch (String(typeId)) {
	case "1":
		content = '<div class="img-text" style="cursor:pointer;"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0]
				+ '"></div><div class="text">'
				+ houseInfo.title
				+ ' [<span id="'
				+ houseInfo.resourceType
				+ '">'
				+ houseInfo.resourceTypeName
				+ '</span>]<br>户型：'
				+ houseInfo.layout.split(",")[0]
				+ '室'
				+ houseInfo.layout.split(",")[1]
				+ '厅'
				+ houseInfo.layout.split(",")[2]
				+ '卫<br>楼层：共'
				+ houseInfo.floor.split(",")[0]
				+ '层	   共'
				+ houseInfo.floor.split("/")[1]
				+ '<br>装修程度：'
				+ houseInfo.decorationLevelName
				+ '  '
				+ houseInfo.age
				+ '年建造<br>行政区：'
				+ houseInfo.officeName
				+ ' 片区：'
				+ houseInfo.serverAreaName
				+ ' 小区：'
				+ houseInfo.communtityName
				+ '<br>房源编号'
				+ getNotValue(houseInfo.resourceNum)
				+ '</div></div>';
		break;
	case "2":
		content = '<div class="img-text" style="cursor:pointer;"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0]
				+ '"></div><div class="text">'
				+ houseInfo.title
				+ ' [<span id="'
				+ houseInfo.resourceType
				+ '">'
				+ houseInfo.resourceTypeName
				+ '</span>]<br>户型：'
				+ houseInfo.layout.split(",")[0]
				+ '室'
				+ houseInfo.layout.split(",")[1]
				+ '厅'
				+ houseInfo.layout.split(",")[2]
				+ '卫<br>楼层：共'
				+ houseInfo.floor
				+ '层<br>装修程度：'
				+ houseInfo.decorationLevelName
				+ '  '
				+ houseInfo.age
				+ '年建造<br>行政区：'
				+ houseInfo.officeName
				+ ' 片区：'
				+ houseInfo.serverAreaName
				+ ' 小区：'
				+ houseInfo.communtityName
				+ '<br>房源编号'
				+ getNotValue(houseInfo.resourceNum)
				+ '</div></div>';
		break;
	case "3":
		content = '<div class="img-text" style="cursor:pointer;"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0]
				+ '"></div><div class="text">'
				+ houseInfo.title
				+ ' [<span id="'
				+ houseInfo.resourceType
				+ '">'
				+ houseInfo.resourceTypeName
				+ '</span>]<br>类型：'
				+ houseInfo.officeTypeName
				+ '    级别：'
				+ houseInfo.officeLevelName
				+ '<br>楼层：'
				+ houseInfo.floor.split("/")[0]
				+ '层       共'
				+ houseInfo.floor.split("/")[1]
				+ '层<br>装修程度：'
				+ houseInfo.decorationLevelName
				+ '  '
				+ houseInfo.age
				+ '年建造<br>行政区：'
				+ houseInfo.officeName
				+ ' 片区：'
				+ houseInfo.serverAreaName
				+ ' 小区：'
				+ houseInfo.communtityName
				+ '<br>房源编号'
				+ getNotValue(houseInfo.resourceNum)
				+ '</div></div>';
		break;
	case "4":
		content = '<div class="img-text" style="cursor:pointer;"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0]
				+ '"></div><div class="text">'
				+ houseInfo.title
				+ ' [<span id="'
				+ houseInfo.resourceType
				+ '">'
				+ houseInfo.resourceTypeName
				+ '</span>]<br>商铺类型：'
				+ houseInfo.shopTypeName
				+ '<br>楼层：'
				+ houseInfo.floor.split("/")[0]
				+ '层      共'
				+ houseInfo.floor.split("/")[1]
				+ '层<br>装修程度：'
				+ houseInfo.decorationLevelName
				+ '  '
				+ houseInfo.age
				+ '年建造<br>行政区：'
				+ houseInfo.officeName
				+ ' 片区：'
				+ houseInfo.serverAreaName
				+ ' 小区：'
				+ houseInfo.communtityName
				+ '<br>房源编号'
				+ getNotValue(houseInfo.resourceNum)
				+ '</div></div>';
		break;
	}
	var contentObj = $(content);
	var moreObj = $('<a href="#">' + houseInfo.rental
			+ '<span>元/月</span><br><a href="#">更多房源>></a>');
	contentObj.click(function() {
		var id = $(this).parent().prev().find("span[id]").attr("id");
		window.location.href = "front-38.html?hId=" + houseInfo.id + "&uId="
				+ id + "&flag=0";
	});
	moreObj.click(function() {
		var id = $(this).parent().parent().find("span[id]").attr("id");
		window.location.href = "front-39.html?id=" + id;
	});
	$(td2).empty().append(contentObj);
	$(td3).text(houseInfo.area + '㎡');
	$(td4).empty().append(moreObj);
}

function getSellContentNoDele_user(houseInfo, selector) {
	var typeId = houseInfo.resourceType;
	var content = '';
	var td2 = $(selector).parent().parent().parent();
	var td3 = $(td2).next();
	var td4 = $(td3).next();
	switch (String(typeId)) {
	case "1":
		content = '<div class="img-text" style="cursor:pointer;"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0]
				+ '"></div><div class="text">'
				+ houseInfo.title
				+ ' [<span id="'
				+ houseInfo.resourceType
				+ '">'
				+ houseInfo.resourceTypeName
				+ '</span>]<br>户型：'
				+ houseInfo.layout.split(",")[0]
				+ '室'
				+ houseInfo.layout.split(",")[1]
				+ '厅'
				+ houseInfo.layout.split(",")[2]
				+ '卫<br>楼层：共'
				+ houseInfo.floor.split(",")[0]
				+ '层	   共'
				+ houseInfo.floor.split("/")[1]
				+ '<br>装修程度：'
				+ houseInfo.decorationLevelName
				+ '  '
				+ houseInfo.age
				+ '年建造<br>行政区：'
				+ houseInfo.officeName
				+ ' 片区：'
				+ houseInfo.serverAreaName
				+ ' 小区：'
				+ houseInfo.communtityName
				+ '<br>房源编号'
				+ getNotValue(houseInfo.resourceNum)
				+ '</div></div>';
		break;
	case "2":
		content = '<div class="img-text" style="cursor:pointer;"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0]
				+ '"></div><div class="text">'
				+ houseInfo.title
				+ ' [<span id="'
				+ houseInfo.resourceType
				+ '">'
				+ houseInfo.resourceTypeName
				+ '</span>]<br>户型：'
				+ houseInfo.layout.split(",")[0]
				+ '室'
				+ houseInfo.layout.split(",")[1]
				+ '厅'
				+ houseInfo.layout.split(",")[2]
				+ '卫<br>楼层：共'
				+ houseInfo.floor
				+ '层<br>装修程度：'
				+ houseInfo.decorationLevelName
				+ '  '
				+ houseInfo.age
				+ '年建造<br>行政区：'
				+ houseInfo.officeName
				+ ' 片区：'
				+ houseInfo.serverAreaName
				+ ' 小区：'
				+ houseInfo.communtityName
				+ '<br>房源编号'
				+ getNotValue(houseInfo.resourceNum)
				+ '</div></div>';
		break;
	case "3":
		content = '<div class="img-text" style="cursor:pointer;"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0]
				+ '"></div><div class="text">'
				+ houseInfo.title
				+ ' [<span id="'
				+ houseInfo.resourceType
				+ '">'
				+ houseInfo.resourceTypeName
				+ '</span>]<br>类型：'
				+ houseInfo.officeTypeName
				+ '    级别：'
				+ houseInfo.officeLevelName
				+ '<br>楼层：'
				+ houseInfo.floor.split("/")[0]
				+ '层       共'
				+ houseInfo.floor.split("/")[1]
				+ '层<br>装修程度：'
				+ houseInfo.decorationLevelName
				+ '  '
				+ houseInfo.age
				+ '年建造<br>行政区：'
				+ houseInfo.officeName
				+ ' 片区：'
				+ houseInfo.serverAreaName
				+ ' 小区：'
				+ houseInfo.communtityName
				+ '<br>房源编号'
				+ getNotValue(houseInfo.resourceNum)
				+ '</div></div>';
		break;
	case "4":
		content = '<div class="img-text" style="cursor:pointer;"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0]
				+ '"></div><div class="text">'
				+ houseInfo.title
				+ ' [<span id="'
				+ houseInfo.resourceType
				+ '">'
				+ houseInfo.resourceTypeName
				+ '</span>]<br>商铺类型：'
				+ houseInfo.shopTypeName
				+ '<br>楼层：'
				+ houseInfo.floor.split("/")[0]
				+ '层      共'
				+ houseInfo.floor.split("/")[1]
				+ '层<br>装修程度：'
				+ houseInfo.decorationLevelName
				+ '  '
				+ houseInfo.age
				+ '年建造<br>行政区：'
				+ houseInfo.officeName
				+ ' 片区：'
				+ houseInfo.serverAreaName
				+ ' 小区：'
				+ houseInfo.communtityName
				+ '<br>房源编号'
				+ getNotValue(houseInfo.resourceNum)
				+ '</div></div>';
		break;
	}
	var contentObj = $(content);
	var moreObj = $('<a href="#">' + houseInfo.wishPrice
			+ '<span>万元</span><br><a href="#">更多房源>></a>');

	contentObj.click(function() {
		var id = $(this).parent().prev().find("span[id]").attr("id");
		window.location.href = "front-38.html?hId=" + houseInfo.id + "&uId="
				+ id + "&flag=1";
	});

	moreObj.click(function() {
		var id = $(this).parent().parent().find("span[id]").attr("id");
		window.location.href = "front-39.html?id=" + id;
	});
	$(td2).empty().append(contentObj);
	$(td3).text(houseInfo.area + '㎡');
	$(td4).empty().append(moreObj);
}

function getRentContentNoDele(houseInfo) {
	var typeId = houseInfo.resourceType;
	switch (String(typeId)) {
	case "1":
		return '<div class="li_middle"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0] + '">' + houseInfo.title
				+ ' [<span id="' + houseInfo.resourceType + '">'
				+ houseInfo.resourceTypeName + '</span>]<br>户型：'
				+ houseInfo.layout.split(",")[0] + '室'
				+ houseInfo.layout.split(",")[1] + '厅'
				+ houseInfo.layout.split(",")[2] + '卫<br>楼层：共'
				+ houseInfo.floor.split(",")[0] + '层	   共'
				+ houseInfo.floor.split("/")[1] + '<br>装修程度：'
				+ houseInfo.decorationLevelName + '  ' + houseInfo.age
				+ '年建造<br>行政区：' + houseInfo.officeName + ' 片区：'
				+ houseInfo.serverAreaName + ' 小区：' + houseInfo.communtityName
				+ '<br>房源编号' + getNotValue(houseInfo.resourceNum)
				+ '</div><div class="word"><p>' + houseInfo.rental
				+ '元/月</p></div><div class="word"><p>' + houseInfo.area
				+ '㎡</p></div></div>';
	case "2":
		return '<div class="li_middle"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0] + '">' + houseInfo.title
				+ ' [<span id="' + houseInfo.resourceType + '">'
				+ houseInfo.resourceTypeName + '</span>]<br>户型：'
				+ houseInfo.layout.split(",")[0] + '室'
				+ houseInfo.layout.split(",")[1] + '厅'
				+ houseInfo.layout.split(",")[2] + '卫<br>楼层：共'
				+ houseInfo.floor + '层<br>装修程度：'
				+ houseInfo.decorationLevelName + '  ' + houseInfo.age
				+ '年建造<br>行政区：' + houseInfo.officeName + ' 片区：'
				+ houseInfo.serverAreaName + ' 小区：' + houseInfo.communtityName
				+ '<br>房源编号' + getNotValue(houseInfo.resourceNum)
				+ '</div><div class="word"><p>' + houseInfo.rental
				+ '元/月</p></div><div class="word"><p>' + houseInfo.area
				+ '㎡</p></div></div>';
	case "3":
		return '<div class="li_middle"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0] + '">' + houseInfo.title
				+ ' [<span id="' + houseInfo.resourceType + '">'
				+ houseInfo.resourceTypeName + '</span>]<br>类型：'
				+ houseInfo.officeTypeName + '    级别：'
				+ houseInfo.officeLevelName + '<br>楼层：'
				+ houseInfo.floor.split("/")[0] + '层       共'
				+ houseInfo.floor.split("/")[1] + '层<br>装修程度：'
				+ houseInfo.decorationLevelName + '  ' + houseInfo.age
				+ '年建造<br>行政区：' + houseInfo.officeName + ' 片区：'
				+ houseInfo.serverAreaName + ' 小区：' + houseInfo.communtityName
				+ '<br>房源编号' + getNotValue(houseInfo.resourceNum)
				+ '</div><div class="word"><p>' + houseInfo.rental
				+ '元/月</p></div><div class="word"><p>' + houseInfo.area
				+ '㎡</p></div></div>';
	case "4":
		return '<div class="li_middle"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0] + '">' + houseInfo.title
				+ ' [<span id="' + houseInfo.resourceType + '">'
				+ houseInfo.resourceTypeName + '</span>]<br>商铺类型：'
				+ houseInfo.shopTypeName + '<br>楼层：'
				+ houseInfo.floor.split("/")[0] + '层      共'
				+ houseInfo.floor.split("/")[1] + '层<br>装修程度：'
				+ houseInfo.decorationLevelName + '  ' + houseInfo.age
				+ '年建造<br>行政区：' + houseInfo.officeName + ' 片区：'
				+ houseInfo.serverAreaName + ' 小区：' + houseInfo.communtityName
				+ '<br>房源编号' + getNotValue(houseInfo.resourceNum)
				+ '</div><div class="word"><p>' + houseInfo.rental
				+ '元/月</p></div><div class="word"><p>' + houseInfo.area
				+ '㎡</p></div></div>';
	}
}

function getSellContentNoDele(houseInfo) {
	var typeId = houseInfo.resourceType;
	switch (String(typeId)) {
	case "1":
		return '<div class="li_middle"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0] + '">' + houseInfo.title
				+ ' [<span id="' + houseInfo.resourceType + '">'
				+ houseInfo.resourceTypeName + '</span>]<br>户型：'
				+ houseInfo.layout.split(",")[0] + '室'
				+ houseInfo.layout.split(",")[1] + '厅'
				+ houseInfo.layout.split(",")[2] + '卫<br>楼层：'
				+ houseInfo.floor.split(",")[0] + '层	   共'
				+ houseInfo.floor.split("/")[1] + '<br>装修程度：'
				+ houseInfo.decorationLevelName + '  ' + houseInfo.age
				+ '年建造<br>行政区：' + houseInfo.officeName + ' 片区：'
				+ houseInfo.serverAreaName + ' 小区：' + houseInfo.communtityName
				+ '<br>房源编号' + getNotValue(houseInfo.resourceNum)
				+ '</div><div class="word"><p>' + houseInfo.wishPrice
				+ '万元</p></div><div class="word"><p>' + houseInfo.area
				+ '㎡</p></div></div>';
	case "2":
		return '<div class="li_middle"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0] + '">' + houseInfo.title
				+ ' [<span id="' + houseInfo.resourceType + '">'
				+ houseInfo.resourceTypeName + '</span>]<br>户型：'
				+ houseInfo.layout.split(",")[0] + '室'
				+ houseInfo.layout.split(",")[1] + '厅'
				+ houseInfo.layout.split(",")[2] + '卫<br>楼层：共'
				+ houseInfo.floor + '层<br>装修程度：'
				+ houseInfo.decorationLevelName + '  ' + houseInfo.age
				+ '年建造<br>行政区：' + houseInfo.officeName + ' 片区：'
				+ houseInfo.serverAreaName + ' 小区：' + houseInfo.communtityName
				+ '<br>房源编号' + getNotValue(houseInfo.resourceNum)
				+ '</div><div class="word"><p>' + houseInfo.rental
				+ '万元</p></div><div class="word"><p>' + houseInfo.area
				+ '㎡</p></div></div>';
	case "3":
		return '<div class="li_middle"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0] + '">' + houseInfo.title
				+ ' [<span id="' + houseInfo.resourceType + '">'
				+ houseInfo.resourceTypeName + '</span>]<br>类型：'
				+ houseInfo.officeTypeName + '    级别：'
				+ houseInfo.officeLevelName + '<br>楼层：'
				+ houseInfo.floor.split("/")[0] + '层       共'
				+ houseInfo.floor.split("/")[1] + '层<br>装修程度：'
				+ houseInfo.decorationLevelName + '  ' + houseInfo.age
				+ '年建造<br>行政区：' + houseInfo.officeName + ' 片区：'
				+ houseInfo.serverAreaName + ' 小区：' + houseInfo.communtityName
				+ '<br>房源编号' + getNotValue(houseInfo.resourceNum)
				+ '</div><div class="word"><p>' + houseInfo.wishPrice
				+ '万元</p></div><div class="word"><p>' + houseInfo.area
				+ '㎡</p></div></div>';
	case "4":
		return '<div class="li_middle"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0] + '">' + houseInfo.title
				+ ' [<span id="' + houseInfo.resourceType + '">'
				+ houseInfo.resourceTypeName + '</span>]<br>商铺类型：'
				+ houseInfo.shopTypeName + '<br>楼层：'
				+ houseInfo.floor.split("/")[0] + '层      共'
				+ houseInfo.floor.split("/")[1] + '层<br>装修程度：'
				+ houseInfo.decorationLevelName + '  ' + houseInfo.age
				+ '年建造<br>行政区：' + houseInfo.officeName + ' 片区：'
				+ houseInfo.serverAreaName + ' 小区：' + houseInfo.communtityName
				+ '<br>房源编号' + getNotValue(houseInfo.resourceNum)
				+ '</div><div class="word"><p>' + houseInfo.wishPrice
				+ '万元</p></div><div class="word"><p>' + houseInfo.area
				+ '㎡</p></div></div>';
	}
}

function getRentContent(houseInfo) {
	var typeId = houseInfo.resourceType;
	switch (String(typeId)) {
	case "1":
		return '<div class="li_middle"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0] + '">' + houseInfo.title
				+ ' [<span id="' + houseInfo.resourceType + '">'
				+ houseInfo.resourceTypeName + '</span>]<br>户型：'
				+ houseInfo.layout.split(",")[0] + '室'
				+ houseInfo.layout.split(",")[1] + '厅'
				+ houseInfo.layout.split(",")[2] + '卫<br>楼层：'
				+ houseInfo.floor.split(",")[0] + '层	   共'
				+ houseInfo.floor.split("/")[1] + '<br>装修程度：'
				+ houseInfo.decorationLevelName + '  ' + houseInfo.age
				+ '年建造<br>行政区：' + houseInfo.officeName + ' 片区：'
				+ houseInfo.serverAreaName + ' 小区：' + houseInfo.communtityName
				+ '<br>房源编号' + getNotValue(houseInfo.resourceNum)
				+ '</div><div class="word"><p>' + houseInfo.rental
				+ '元/月</p><a href="#">删除</a></div><div class="word"><p>'
				+ houseInfo.area + '㎡</p></div></div>';
	case "2":
		return '<div class="li_middle"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0] + '">' + houseInfo.title
				+ ' [<span id="' + houseInfo.resourceType + '">'
				+ houseInfo.resourceTypeName + '</span>]<br>户型：'
				+ houseInfo.layout.split(",")[0] + '室'
				+ houseInfo.layout.split(",")[1] + '厅'
				+ houseInfo.layout.split(",")[2] + '卫<br>楼层：共'
				+ houseInfo.floor + '层<br>装修程度：'
				+ houseInfo.decorationLevelName + '  ' + houseInfo.age
				+ '年建造<br>行政区：' + houseInfo.officeName + ' 片区：'
				+ houseInfo.serverAreaName + ' 小区：' + houseInfo.communtityName
				+ '<br>房源编号' + getNotValue(houseInfo.resourceNum)
				+ '</div><div class="word"><p>' + houseInfo.rental
				+ '元/月</p><a href="#">删除</a></div><div class="word"><p>'
				+ houseInfo.area + '㎡</p></div></div>';
	case "3":
		return '<div class="li_middle"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0] + '">' + houseInfo.title
				+ ' [<span id="' + houseInfo.resourceType + '">'
				+ houseInfo.resourceTypeName + '</span>]<br>类型：'
				+ houseInfo.officeTypeName + '    级别：'
				+ houseInfo.officeLevelName + '<br>楼层：'
				+ houseInfo.floor.split("/")[0] + '层       共'
				+ houseInfo.floor.split("/")[1] + '层<br>装修程度：'
				+ houseInfo.decorationLevelName + '  ' + houseInfo.age
				+ '年建造<br>行政区：' + houseInfo.officeName + ' 片区：'
				+ houseInfo.serverAreaName + ' 小区：' + houseInfo.communtityName
				+ '<br>房源编号' + getNotValue(houseInfo.resourceNum)
				+ '</div><div class="word"><p>' + houseInfo.rental
				+ '元/月</p><a href="#">删除</a></div><div class="word"><p>'
				+ houseInfo.area + '㎡</p></div></div>';
	case "4":
		return '<div class="li_middle"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0] + '">' + houseInfo.title
				+ ' [<span id="' + houseInfo.resourceType + '">'
				+ houseInfo.resourceTypeName + '</span>]<br>商铺类型：'
				+ houseInfo.shopTypeName + '<br>楼层：'
				+ houseInfo.floor.split("/")[0] + '层      共'
				+ houseInfo.floor.split("/")[1] + '层<br>装修程度：'
				+ houseInfo.decorationLevelName + '  ' + houseInfo.age
				+ '年建造<br>行政区：' + houseInfo.officeName + ' 片区：'
				+ houseInfo.serverAreaName + ' 小区：' + houseInfo.communtityName
				+ '<br>房源编号' + getNotValue(houseInfo.resourceNum)
				+ '</div><div class="word"><p>' + houseInfo.rental
				+ '元/月</p><a href="#">删除</a></div><div class="word"><p>'
				+ houseInfo.area + '㎡</p></div></div>';
	}
}

function getSellContent(houseInfo) {
	var typeId = houseInfo.resourceType;
	switch (String(typeId)) {
	case "1":
		return '<div class="li_middle"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0] + '">' + houseInfo.title
				+ ' [<span id="' + houseInfo.resourceType + '">'
				+ houseInfo.resourceTypeName + '</span>]<br>户型：'
				+ houseInfo.layout.split(",")[0] + '室'
				+ houseInfo.layout.split(",")[1] + '厅'
				+ houseInfo.layout.split(",")[2] + '卫<br>楼层：'
				+ houseInfo.floor.split("/")[0] + '层      共：'
				+ houseInfo.floor.split("/")[1] + '<br>装修程度：'
				+ houseInfo.decorationLevelName + '  ' + houseInfo.age
				+ '年建造<br>行政区：' + houseInfo.officeName + ' 片区：'
				+ houseInfo.serverAreaName + ' 小区：' + houseInfo.communtityName
				+ '<br>房源编号' + getNotValue(houseInfo.resourceNum)
				+ '</div><div class="word"><p>' + houseInfo.wishPrice
				+ '万元</p><a href="#">删除</a></div><div class="word"><p>'
				+ houseInfo.area + '㎡</p></div></div>';
	case "2":
		return '<div class="li_middle"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0] + '">' + houseInfo.title
				+ ' [<span id="' + houseInfo.resourceType + '">'
				+ houseInfo.resourceTypeName + '</span>]<br>户型：'
				+ houseInfo.layout.split(",")[0] + '室'
				+ houseInfo.layout.split(",")[1] + '厅'
				+ houseInfo.layout.split(",")[2] + '卫<br>楼层：共'
				+ houseInfo.floor + '层<br>装修程度：'
				+ houseInfo.decorationLevelName + '  ' + houseInfo.age
				+ '年建造<br>行政区：' + houseInfo.officeName + ' 片区：'
				+ houseInfo.serverAreaName + ' 小区：' + houseInfo.communtityName
				+ '<br>房源编号' + getNotValue(houseInfo.resourceNum)
				+ '</div><div class="word"><p>' + houseInfo.wishPrice
				+ '万元</p><a href="#">删除</a></div><div class="word"><p>'
				+ houseInfo.area + '㎡</p></div></div>';
	case "3":
		return '<div class="li_middle"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0] + '">' + houseInfo.title
				+ ' [<span id="' + houseInfo.resourceType + '">'
				+ houseInfo.resourceTypeName + '</span>]<br>类型：'
				+ houseInfo.officeTypeName + '<br>级别：'
				+ houseInfo.officeLevelName + '<br>楼层：'
				+ houseInfo.floor.split("/")[0] + '层      共'
				+ houseInfo.floor.split("/")[1] + '层<br>装修程度：'
				+ houseInfo.decorationLevelName + '  ' + houseInfo.age
				+ '年建造<br>行政区：' + houseInfo.officeName + ' 片区：'
				+ houseInfo.serverAreaName + ' 小区：' + houseInfo.communtityName
				+ '<br>房源编号' + getNotValue(houseInfo.resourceNum)
				+ '</div><div class="word"><p>' + houseInfo.wishPrice
				+ '万元</p><a href="#">删除</a></div><div class="word"><p>'
				+ houseInfo.area + '㎡</p></div></div>';
	case "4":
		return '<div class="li_middle"><div class="img"><img src="'
				+ houseInfo.photo.split(",")[0] + '">' + houseInfo.title
				+ ' [<span id="' + houseInfo.resourceType + '">'
				+ houseInfo.resourceTypeName + '</span>]<br>商铺类型：'
				+ houseInfo.shopTypeName + '<br>楼层：'
				+ houseInfo.floor.split("/")[0] + '层      共：'
				+ houseInfo.floor.split("/")[1] + '<br>装修程度：'
				+ houseInfo.decorationLevelName + '  ' + houseInfo.age
				+ '年建造<br>行政区：' + houseInfo.officeName + ' 片区：'
				+ houseInfo.serverAreaName + ' 小区：' + houseInfo.communtityName
				+ '<br>房源编号' + getNotValue(houseInfo.resourceNum)
				+ '</div><div class="word"><p>' + houseInfo.wishPrice
				+ '万元</p><a href="#">删除</a></div><div class="word"><p>'
				+ houseInfo.area + '㎡</p></div></div>';
	}
}

function getStars(stars) {
	var len = 0;
	if (stars == undefined) {
		return 'starIn starIn0';
	} else {
		switch (stars) {
		case "0":
			len = 0;
			break;
		case "0.5":
			len = 1;
			break;
		case "1":
			len = 2;
			break;
		case "1.5":
			len = 3;
			break;
		case "2":
			len = 4;
			break;
		case "2.5":
			len = 5;
			break;
		case "3":
			len = 6;
			break;
		case "3.5":
			len = 7;
			break;
		case "4":
			len = 8;
			break;
		case "4.5":
			len = 9;
			break;
		case "5":
			len = 10;
			break;
		}
		return 'starIn starIn' + String(len);
	}
}

function getCerts_jjrInfo(certs) {
	if (getNotValue(certs) == "无") {
		return "无";
	}
	switch (certs.length) {
	case 0:
		return '';
	case 1:
		return '<img src="/zfbServer/static/zfbcommonfile/images/test_cer_1.jpg" title="'
				+ certs[0].certificationName + '">';
	case 2:
		return '<img src="/zfbServer/static/zfbcommonfile/images/test_cer_1.jpg" title="'
				+ certs[0].certificationName
				+ '"> <img src="/zfbServer/static/zfbcommonfile/images/test_cer_2.jpg" title="'
				+ certs[1].certificationName + '">';
	case 3:
		return '<img src="/zfbServer/static/zfbcommonfile/images/test_cer_1.jpg" title="'
				+ certs[0].certificationName
				+ '"> <img src="/zfbServer/static/zfbcommonfile/images/test_cer_2.jpg" title="'
				+ certs[1].certificationName
				+ '"><img src="/zfbServer/static/zfbcommonfile/images/test_cer_3.jpg" title="'
				+ certs[2].certificationName + '">';
	default:
		return '<img src="/zfbServer/static/zfbcommonfile/images/test_cer_1.jpg" title="'
				+ certs[0].certificationName
				+ '"> <img src="/zfbServer/static/zfbcommonfile/images/test_cer_2.jpg" title="'
				+ certs[1].certificationName
				+ '"><img src="/zfbServer/static/zfbcommonfile/images/test_cer_3.jpg" title="'
				+ certs[2].certificationName + '">';
	}
}

function getCerts(certs) {
	if (getNotValue(certs) == "无") {
		return "无";
	}
	switch (certs.length) {
	case 0:
		return '';
	case 1:
		return '<img src="/zfbServer/static/zfbcommonfile/images/test_cer_1.jpg" title="'
				+ certs[0].name + '">';
	case 2:
		return '<img src="/zfbServer/static/zfbcommonfile/images/test_cer_1.jpg" title="'
				+ certs[0].name
				+ '"> <img src="/zfbServer/static/zfbcommonfile/images/test_cer_2.jpg" title="'
				+ certs[1].name + '">';
	case 3:
		return '<img src="/zfbServer/static/zfbcommonfile/images/test_cer_1.jpg" title="'
				+ certs[0].name
				+ '"> <img src="/zfbServer/static/zfbcommonfile/images/test_cer_2.jpg" title="'
				+ certs[1].name
				+ '"><img src="/zfbServer/static/zfbcommonfile/images/test_cer_3.jpg" title="'
				+ certs[2].name + '">';
	default:
		return '<img src="/zfbServer/static/zfbcommonfile/images/test_cer_1.jpg" title="'
				+ certs[0].name
				+ '"> <img src="/zfbServer/static/zfbcommonfile/images/test_cer_2.jpg" title="'
				+ certs[1].name
				+ '"><img src="/zfbServer/static/zfbcommonfile/images/test_cer_3.jpg" title="'
				+ certs[2].name + '">';
	}
}

function getNotValue(key) {
	return (key == undefined || key == "" || key == null) ? "无" : key;
}

function getSafeValue(values) {
	for ( var value in values) {
		values[value] = (value == undefined || value == null) ? ""
				: values[value];
	}
}

function cancelBroker(sid) {
	var params = {
		"sid" : sid
	};
	var cancelFocusUrl = commonUrl + "a/admin/HouseSolicitude/deleteById";
	$.post(cancelFocusUrl, params, function(data) {
		if (data.message == "success") {
			alert("取消关注成功！");
		}
	});
}

function focusBroker(solicitideId) {
	var focusUrl = getUrl() + "a//admin/HouseSolicitude/save";
	var params = {
		"solicitideId" : solicitideId
	};
	$.post(focusUrl, params, function(data) {
		if (data.message == "success") {
			alert("关注成功！");
		}
	});
}

function GetQueryString(name) {
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
	var r = window.location.search.substr(1).match(reg);
	if (r != null)
		return unescape(r[2]);
	return null;
}

function roundImages() {
	var size = $(".swiperBottomHide ul li").size();
	var index = 0;
	var selected = 0;
	$(".swiperBottomHide ul li").eq(0).addClass("selected");
	$(".swiperBottomRight").click(function() {
		if (index < size - 5 && selected > 1) {
			index++;
			$(".swiperBottomHide ul").animate({
				left : '-=76px'
			}, "slow");
		}
		if (selected < size - 1) {
			selected++;
			$(".swiperTop ul").animate({
				left : '-=452px'
			}, "slow");
			$(".swiperBottomHide ul li").removeClass("selected");
			$(".swiperBottomHide ul li").eq(selected).addClass("selected");
		}
	});
	$(".swiperBottomLeft").click(function() {
		if (index != 0 && selected < size - 2) {
			index--;
			$(".swiperBottomHide ul").animate({
				left : '+=76px'
			}, "slow");
		}
		if (selected != 0) {
			selected--;
			$(".swiperTop ul").animate({
				left : '+=452px'
			}, "slow");
			$(".swiperBottomHide ul li").removeClass("selected");
			$(".swiperBottomHide ul li").eq(selected).addClass("selected");
		}
	});
	$(".swiperBottomHide ul li").click(function() {
		var _selected = $(this).index();
		if (_selected == selected)
			return;
		;
		if (_selected > selected) {
			switch (_selected - selected) {
			case 1:
				$(".swiperTop ul").animate({
					left : '-=452px'
				}, "slow");
				break;
			case 2:
				$(".swiperTop ul").animate({
					left : '-=904px'
				}, "slow");
				break;
			case 3:
				$(".swiperTop ul").animate({
					left : '-=1356px'
				}, "slow");
				break;
			case 4:
				$(".swiperTop ul").animate({
					left : '-=1808px'
				}, "slow");
				break;
			default:
				return;
			}
			if (selected < size - 3) {
				if (selected < 2 && _selected == 3) {
					index = 0;
					$(".swiperBottomHide ul").animate({
						left : '-=76px'
					}, "slow");
				} else if (selected < 2 && _selected == 4) {
					index = 1;
					$(".swiperBottomHide ul").animate({
						left : '-=152px'
					}, "slow");
				} else if (selected > 1 && selected != size - 4) {
					if (_selected - selected == 1) {
						index++;
						$(".swiperBottomHide ul").animate({
							left : '-=76px'
						}, "slow");
					} else if (_selected - selected == 2) {
						index += 2;
						$(".swiperBottomHide ul").animate({
							left : '-=152px'
						}, "slow");
					}
				} else if (selected == size - 4) {
					index++;
					$(".swiperBottomHide ul").animate({
						left : '-=76px'
					}, "slow");
				}
			}
			selected = _selected;
			$(".swiperBottomHide ul li").removeClass("selected");
			$(".swiperBottomHide ul li").eq(selected).addClass("selected");
		}
		if (_selected < selected) {
			switch (selected - _selected) {
			case 1:
				$(".swiperTop ul").animate({
					left : '+=452px'
				}, "slow");
				break;
			case 2:
				$(".swiperTop ul").animate({
					left : '+=904px'
				}, "slow");
				break;
			case 3:
				$(".swiperTop ul").animate({
					left : '+=1356px'
				}, "slow");
				break;
			case 4:
				$(".swiperTop ul").animate({
					left : '+=1808px'
				}, "slow");
				break;
			default:
				return;
			}
			if (selected > 2) {
				if (selected > size - 3 && _selected == size - 4) {
					index = size - 6;
					$(".swiperBottomHide ul").animate({
						left : '+=76px'
					}, "slow");
				} else if (selected > size - 3 && _selected == size - 5) {
					index = size - 7;
					$(".swiperBottomHide ul").animate({
						left : '+=152px'
					}, "slow");
				} else if (selected < size - 2 && selected != 3) {
					if (selected - _selected == 1) {
						index--;
						$(".swiperBottomHide ul").animate({
							left : '+=76px'
						}, "slow");
					} else if (selected - _selected == 2) {
						index -= 2;
						$(".swiperBottomHide ul").animate({
							left : '+=152px'
						}, "slow");
					}
				} else if (selected == 3) {
					index--;
					$(".swiperBottomHide ul").animate({
						left : '+=76px'
					}, "slow");
				}
			}
			selected = _selected;
			$(".swiperBottomHide ul li").removeClass("selected");
			$(".swiperBottomHide ul li").eq(selected).addClass("selected");
		}
	});
}

function loadFocus(id, isPerson) {
	var isFocusUrl = getUrl() + 'a/admin/HouseSolicitude/isGuanzu';
	var result = false;
	var params = {
		"solicitideId" : id
	};
	$.post(isFocusUrl, params, function(data) {
		if (data.message == "success") {
			result = Boolean(data.data);
			retFocus(isPerson, result);
		}
	});
}

function retFocus(isPerson, result) {
	if (isPerson) {
		if (result) {
			$('.focus').text('取消关注');
		} else {
			$('.focus').text('关注');
		}
	} else {
		if (result) {
			$('.title > a:nth-child(1)').text('取消收藏');
		} else {
			$('.title > a:nth-child(1)').text('收藏');
		}
	}
}

function loadJJrInfo(userId) {
	var jjrInfoUrl = getUrl() + "a/sys/user/getJjrDetail";
	var params = {
		"userId" : userId
	};
	$.post(jjrInfoUrl, params, function(data) {
		if (data.message == "success") {
			getJjrData(data);
		}
	});
}

function getJjrData(jjrInfo) {
	$('.area1').empty().html(
			'<img src=' + jjrInfo.data.photo + '><br/>' + jjrInfo.data.name
					+ '<br />电话：' + jjrInfo.data.phone);
	$('.area4').html(
			'服务区域：' + jjrInfo.data.officeName + '、'
					+ jjrInfo.data.serviceDistrictName + '<br>服务小区：'
					+ jjrInfo.data.serviceVillageName + '<br />').html(
			'<span>租房成交量：' + jjrInfo.data.rentVolume + '套</span><br />').html(
			'<span>售房成交量：'
					+ jjrInfo.data.sellVolume
					+ '套</span><br />好评率：'
					+ (jjrInfo.satisfyDegree == undefined ? "0"
							: jjrInfo.data.satisfyDegree) + '%');
	$('.area2 .starIn').removeClass().addClass(getStars(jjrInfo.data.star));
	$('.area3').empty().html(getCerts_jjrInfo(jjrInfo.data.certifications));
}

function getProvideNames(dataArr, selectArr) {
	var results = "";
	for ( var index in selectArr) {
		for ( var key in dataArr) {
			if (selectArr[index] == dataArr[key].value) {
				results += dataArr[key].label + ",";
			}
		}
	}
	return results.substr(0, results.length - 1);
}

function zzLoad() {
	$('.tab > a:first').click(function() {
		window.location.href = "front-26.html";
	})
	$('.tab > a:last').click(function() {
		window.location.href = "front-31.html";
	})
	otherCloseValue(".sidebar .main .wrap .tab a", "selected");
}

function zzLoad_client() {
	$('.tab > a:first').click(function() {
		window.location.href = "front-7.html";
	})
	$('.tab > a:last').click(function() {
		window.location.href = "front-42.html";
	})
	otherCloseValue(".sidebar .main .wrap .tab a", "selected");
}

function zzRentLoad() {
    $(
	    '.form > table > tbody > tr:nth-child(1) > td:nth-child(2) > span:nth-child(1)')
	    .click(function() {
		window.location.href = "front-26.html";
	    });

    $(
	    '.form > table > tbody > tr:nth-child(1) > td:nth-child(2) > span:nth-child(2)')
	    .click(function() {
		window.location.href = "front-30.html";
	    });
}

function zzRentLoad_client() {
    $(
	    '.form > table > tbody > tr:nth-child(1) > td:nth-child(2) > span:nth-child(1)')
	    .click(function() {
		window.location.href = "front-7.html";
	    });

    $(
	    '.form > table > tbody > tr:nth-child(1) > td:nth-child(2) > span:nth-child(2)')
	    .click(function() {
		window.location.href = "front-44.html";
	    });
}

function selOrCalLabel(selector, cls) {
    $(selector).click(function() {
	$(this).toggleClass(cls);
    });
}

function syLoad() {
	$('body > div.main > div.ownCom > div > div > a:first').click(function() {
		window.location.href = "front-30.html";
	})
	$('body > div.main > div.ownCom > div > div > a:last').click(function() {
		window.location.href = "front-32.html";
	})
	otherCloseValue("body > div.main > div.ownCom > div > div > a", "selected");
}

function syLoad_client() {
	$('body > div.main > div.ownCom > div > div > a:first').click(function() {
		window.location.href = "front-44.html";
	})
	$('body > div.main > div.ownCom > div > div > a:last').click(function() {
		window.location.href = "front-43.html";
	})
	otherCloseValue("body > div.main > div.ownCom > div > div > a", "selected");
}

var divStr = '<div style="clear:both;display:none;background-color:#2A2C32;color: #ABAEBE;font-size: 18px;padding:3px 5px 3px 5px;width: 110px;text-align: center;border-radius:5px"><span style="cursor:pointer;width:100%;display:block;border-radius:3px">注销</span><a style="font-size:18px;width:100%;display:block;border-radius:3px;color:#ABAEBE;text-decoration: none" href="'
		+ ctx + '"+"/h/front-19.html">设置</a>';

function sprentLoad() {
	$(
			"body > div.main > div.ownCom > div > form > table > tbody > tr:nth-child(2) > td:nth-child(2) span:nth-child(1)")
			.click(function() {
				window.location.href = "front-30.html";
			});
	$(
			"body > div.main > div.ownCom > div > form > table > tbody > tr:nth-child(2) > td:nth-child(2) span:nth-child(2)")
			.click(function() {
				window.location.href = "front-34.html";
			});
}

function sprentLoad_client() {
	$(
			"body > div.main > div.ownCom > div > form > table > tbody > tr:nth-child(2) > td:nth-child(2) span:nth-child(1)")
			.click(function() {
				window.location.href = "front-44.html";
			});
	$(
			"body > div.main > div.ownCom > div > form > table > tbody > tr:nth-child(2) > td:nth-child(2) span:nth-child(2)")
			.click(function() {
				window.location.href = "front-45.html";
			});
}

function spsellLoad() {
	$(
			"body > div.main > div.ownCom > div > form > table > tbody > tr:nth-child(2) > td:nth-child(2) span:nth-child(1)")
			.click(function() {
				window.location.href = "front-32.html";
			});
	$(
			"body > div.main > div.ownCom > div > form > table > tbody > tr:nth-child(2) > td:nth-child(2) span:nth-child(2)")
			.click(function() {
				window.location.href = "front-33.html";
			});
}

function spsellLoad_client() {
	$(
			"body > div.main > div.ownCom > div > form > table > tbody > tr:nth-child(2) > td:nth-child(2) span:nth-child(1)")
			.click(function() {
				window.location.href = "front-43.html";
			});
	$(
			"body > div.main > div.ownCom > div > form > table > tbody > tr:nth-child(2) > td:nth-child(2) span:nth-child(2)")
			.click(function() {
				window.location.href = "front-45.html";
			});
}

function zzSellLoad() {
	$(
			'body > div.main > div.ownCom > div > form > table > tbody > tr:nth-child(1) > td:nth-child(2) > span:nth-child(1)')
			.click(function() {
				window.location.href = "front-31.html";
			});

	$(
			'body > div.main > div.ownCom > div > form > table > tbody > tr:nth-child(1) > td:nth-child(2) > span:nth-child(2)')
			.click(function() {
				window.location.href = "front-32.html";
			});
}

function zzSellLoad_client() {
	$(
			'body > div.main > div.ownCom > div > form > table > tbody > tr:nth-child(1) > td:nth-child(2) > span:nth-child(1)')
			.click(function() {
				window.location.href = "front-42.html";
			});

	$(
			'body > div.main > div.ownCom > div > form > table > tbody > tr:nth-child(1) > td:nth-child(2) > span:nth-child(2)')
			.click(function() {
				window.location.href = "front-43.html";
			});
}

function loadAreaData() {
    var commonUrl = getUrl();
    var xingzhengquUrl = commonUrl + "a/c/getAreaList";
    var shangquUrl = commonUrl + "a/c/getShangquanList";
    var xiaoquUrl = commonUrl + "a/c/getXiaoQu";
    loadRemoteData(
	    xingzhengquUrl,
	    '.form > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(2) > select:nth-child(1)',
	    loadOptionLabelById);
    $(
	    '.form > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(2) > select:nth-child(1)')
	    .change(
		    function() {
			clearSelect2();
			var parentId = $(this).children("option:selected")
				.val();
			if (parentId != "行政区") {
			    var params = {
				"parentId" : parentId
			    };
			    $
				    .post(
					    shangquUrl,
					    params,
					    function(data) {
						loadOption(
							'.form > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(2) > select:nth-child(2)',
							data.data);
					    });
			}
		    });

    $(
	    '.form > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(2) > select:nth-child(2)')
	    .change(
		    function() {
			$(
				'.form > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(2) > select:nth-child(3)')
				.empty().append($('<option>小区</option>'));
			var parentId = $(this).children("option:selected")
				.val();
			if (parentId != "片区") {
			    var params = {
				"parentId" : parentId
			    };
			    $
				    .post(
					    xiaoquUrl,
					    params,
					    function(data) {
						loadOption(
							'.form > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(2) > select:nth-child(3)',
							data.data);
					    });
			}
		    });
}

function clearSelect2() {
	$(
			'.form > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(2) > select:nth-child(2)')
			.empty().append($('<option>片区</option>'));
	$(
			'.form > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(3) > td:nth-child(2) > select:nth-child(3)')
			.empty().append($('<option>小区</option>'));
}